package com.woniuxy.springbootpro.utile;

import javax.servlet.http.Cookie;

public class CookieUtil {

    public static Cookie getCookie(String cookieName,Cookie[] cookies){
        if(cookies == null || cookies.length == 0 || cookieName == null || cookieName.length() == 0){
            return null;
        }

        for (Cookie cookie : cookies) {
            if(cookie.getName().equals(cookieName)){
                return cookie;
            }
        }

        return null;
    }

}
